cc_library(
    name = 'protobuf',
    srcs = [
        'google/protobuf/compiler/importer.cc',
        'google/protobuf/compiler/parser.cc',
        'google/protobuf/descriptor.cc',
        'google/protobuf/descriptor_database.cc',
        'google/protobuf/descriptor.pb.cc',
        'google/protobuf/dynamic_message.cc',
        'google/protobuf/extension_set.cc',
        'google/protobuf/extension_set_heavy.cc',
        'google/protobuf/generated_message_reflection.cc',
        'google/protobuf/generated_message_util.cc',
        'google/protobuf/message.cc',
        'google/protobuf/message_lite.cc',
        'google/protobuf/reflection_ops.cc',
        'google/protobuf/repeated_field.cc',
        'google/protobuf/service.cc',
        'google/protobuf/text_format.cc',
        'google/protobuf/unknown_field_set.cc',
        'google/protobuf/wire_format.cc',
        'google/protobuf/wire_format_lite.cc',
        'google/protobuf/io/coded_stream.cc',
        'google/protobuf/io/gzip_stream.cc',
        'google/protobuf/io/printer.cc',
        'google/protobuf/io/tokenizer.cc',
        'google/protobuf/io/zero_copy_stream.cc',
        'google/protobuf/io/zero_copy_stream_impl.cc',
        'google/protobuf/io/zero_copy_stream_impl_lite.cc',
        'google/protobuf/stubs/common.cc',
        'google/protobuf/stubs/once.cc',
        'google/protobuf/stubs/structurally_valid.cc',
        'google/protobuf/stubs/strutil.cc',
        'google/protobuf/stubs/substitute.cc',
    ],
    deps = [
        '//thirdparty/glog:glog',
        '#pthread',
        '#z'
    ],
    incs = '..',
    warning = 'no'
)

cc_library(
    name = 'protoc',
    srcs = [
        'google/protobuf/compiler/code_generator.cc',
        'google/protobuf/compiler/command_line_interface.cc',
        'google/protobuf/compiler/plugin.cc',
        'google/protobuf/compiler/plugin.pb.cc',
        'google/protobuf/compiler/subprocess.cc',
        'google/protobuf/compiler/zip_writer.cc',
        'google/protobuf/compiler/cpp/cpp_enum.cc',
        'google/protobuf/compiler/cpp/cpp_enum_field.cc',
        'google/protobuf/compiler/cpp/cpp_extension.cc',
        'google/protobuf/compiler/cpp/cpp_field.cc',
        'google/protobuf/compiler/cpp/cpp_file.cc',
        'google/protobuf/compiler/cpp/cpp_generator.cc',
        'google/protobuf/compiler/cpp/cpp_helpers.cc',
        'google/protobuf/compiler/cpp/cpp_message.cc',
        'google/protobuf/compiler/cpp/cpp_message_field.cc',
        'google/protobuf/compiler/cpp/cpp_primitive_field.cc',
        'google/protobuf/compiler/cpp/cpp_service.cc',
        'google/protobuf/compiler/cpp/cpp_string_field.cc',
        'google/protobuf/compiler/java/java_enum.cc',
        'google/protobuf/compiler/java/java_enum_field.cc',
        'google/protobuf/compiler/java/java_extension.cc',
        'google/protobuf/compiler/java/java_field.cc',
        'google/protobuf/compiler/java/java_file.cc',
        'google/protobuf/compiler/java/java_generator.cc',
        'google/protobuf/compiler/java/java_helpers.cc',
        'google/protobuf/compiler/java/java_message.cc',
        'google/protobuf/compiler/java/java_message_field.cc',
        'google/protobuf/compiler/java/java_primitive_field.cc',
        'google/protobuf/compiler/java/java_service.cc',
        'google/protobuf/compiler/java/java_string_field.cc',
        'google/protobuf/compiler/python/python_generator.cc'],
    deps = [
        ':protobuf',
        '//thirdparty/glog:glog',
    ],
    incs = ['.', '..'],
    warning = 'no'
)

cc_binary(
    name = 'protoc.bin',
    srcs = 'google/protobuf/compiler/main.cc',
    deps = ':protoc'
)
